<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:util="http://java.sun.com/jsf/composite/util">
	<!-- Dialogo Filtrar Atores -->
	<p:dialog appendToBody="true" closable="true" header="#{i18n.Ator_DialogoFiltrar_Header}"
		modal="true" widgetVar="dialogoFiltrarAtor" width="540" resizable="false">
		<h:form id="formFiltrarAtor">
			<div class="dialogo_container_18">
				<util:dialogoLabel value="#{i18n.Ator_Nome}" />
				<div class="dialogo_grid_18">
					<p:inputText value="#{atorBean.varBuscaAtor}" styleClass="dialogo_width_18" />
				</div>
				<util:hr />
				<div class="dialogo_grid_18 right">
					<p:commandButton action="#{atorBean.filtrarTodos}" update="@form, :formPrincipal" 
						value="#{i18n.btn_Todos}" onstart="spinner.show();"
						oncomplete="spinner.hide();dialogoFiltrarAtor.hide();"/>
					<p:commandButton action="#{atorBean.filtrar}" update="@form, :formPrincipal" 
						value="#{i18n.btn_Filtrar}" onstart="spinner.show();" 
						oncomplete="spinner.hide();dialogoFiltrarAtor.hide();"/>
					<p:commandButton onclick="dialogoFiltrarAtor.hide()" type="button" 
						value="#{i18n.btn_Cancelar}" />
				</div>
			</div>	
		</h:form>
	</p:dialog>
	
	<!-- Dialogo Novo Ator -->
	<p:dialog appendToBody="true" closable="true" header="#{i18n.Ator_DialogoNovo_Header}"
		modal="true" widgetVar="dialogoNovoAtor" width="540" resizable="false">
		<h:form id="formNovoAtor">
			<div class="dialogo_container_18">
				<div class="dialogo_grid_18">
					<p:messages closable="true" id="messageNovoAtor" />
				</div>
				<util:dialogoLabel value="#{i18n.Ator_Nome}" />
				<div class="dialogo_grid_18">
					<p:inputText value="#{atorBean.atorInstance.nome}" styleClass="dialogo_width_18" 
						required="true" requiredMessage="#{i18n.Ator_Required_Nome}" maxlength="128"
						validator="#{atorBean.validateNomeUnico}" />
				</div>
				<util:hr />
				<div class="dialogo_grid_18">
					<p:commandButton onclick="dialogoNovoAtor.hide()" type="button" 
						value="#{i18n.btn_Desistir}" style="float:right"/>
					<p:commandButton action="#{atorBean.salvar}" update="@form, :formPrincipal" 
						value="#{i18n.btn_Salvar}" style="float:right" 
						onstart="spinner.show();" oncomplete="onCompleteNovoAtor();"/>
				</div>
			</div>	
		</h:form>
	</p:dialog>
	
	<!-- Dialogo Editar Ator -->
	<p:dialog appendToBody="true" closable="true" header="#{i18n.Ator_DialogoEditar_Header}"
		modal="true" widgetVar="dialogoEditarAtor" width="540" resizable="false">
		<h:form id="formEditarAtor">
			<div class="dialogo_container_18">
				<div class="dialogo_grid_18">
					<p:messages closable="true" id="messageNovoAtor" />
				</div>
				<util:dialogoLabel value="#{i18n.Ator_Nome}" />
				<div class="dialogo_grid_18">
					<p:inputText value="#{atorBean.atorInstance.nome}" styleClass="dialogo_width_18" 
						required="true" requiredMessage="#{i18n.Ator_Required_Nome}" maxlength="128"
						validator="#{atorBean.validateNomeUnico}"  />
				</div>
				<util:hr />
				<div class="dialogo_grid_18">
					<p:commandButton onclick="dialogoEditarAtor.hide()" type="button" 
						value="#{i18n.btn_Desistir}" style="float:right"/>
					<p:commandButton action="#{atorBean.atualizar}" update="@form, :formPrincipal" 
						value="#{i18n.btn_Salvar}" style="float:right" 
						onstart="spinner.show();" oncomplete="onCompleteEditarAtor();"/>
				</div>
			</div>	
		</h:form>
	</p:dialog>
	
	<p:dialog style="position:absolute" header="#{i18n.DialogoExcluir_Header}" widgetVar="dialogoExcluir" 
		width="450" modal="true" appendToBody="true" closable="true" resizable="false" >
		<h:form id="formExcluir">  
			<div class="dialog_container_16">
				<div class="dialog_grid_16 div-label" style="margin-top: 7px; margin-bottom: 7px;">
					<center><label class="label">#{atorBean.msgExclusao}</label></center>
				</div>
				<div class="dialog_grid_16"><hr /></div>
				<div class="dialog_grid_16 right">
					<p:commandButton value="#{i18n.DialogoExcluir_Confirmar}" update=":formPrincipal"
						onstart="spinner.show();" oncomplete="spinner.hide();dialogoExcluir.hide();" 
						action="#{atorBean.excluir}" />
					<p:commandButton value="#{i18n.DialogoExcluir_Cancelar}" type="button" onclick="dialogoExcluir.hide();" />
				</div>
			</div>
		</h:form>
	</p:dialog>
	
	<util:dialogoSelecione />
	
</f:view>
